package com.stockz.indicator.supportResistence;

import java.util.List;

import com.stockz.core.model.Bar;
import com.stockz.core.util.BarUtil.BarValueType;
import com.stockz.core.util.ListUtil;
import com.stockz.indicator.Indicator;

public class SupportResistenceIndicator implements Indicator<SupportResistenceIndicatorConfiguration>{

	private SupportResistenceIndicatorConfiguration supportResistenceIndicatorConfiguration
							= new SupportResistenceIndicatorConfiguration();
	private BarValueType barValueType = BarValueType.CLOSE;
	
	@Override
	public BarValueType getBarValueType() {
		return barValueType;
	}

	@Override
	public SupportResistenceIndicatorConfiguration getIndicatorConfiguration() {
		return supportResistenceIndicatorConfiguration;
	}

	@Override
	public double getValue(List<Bar> barList) {
		throw new UnsupportedOperationException();
	}
	
	public List<Bar> getExtreams(List<Bar> barList){
		return 	ListUtil.getExtreams(barList, 
				supportResistenceIndicatorConfiguration.getPercentage(), 
				barValueType);
	}

	@Override
	public double[] getValues(List<Bar> barList) {
		throw new UnsupportedOperationException();
	}

	@Override
	public void setBarValueType(BarValueType barValueType) {
		this.barValueType = barValueType;
	}

}
